Log in Register Dashboard Temp Share Shortlinks Frames API

cody - HTMLify profile

cody's Profile Picture

cody

4270 Files

632542 Views

Latest files of /cody/solygambas/html-css-javascript-projects/020-button ripple effect

style.css cody/solygambas/html-css-javascript-projects/020-button ripple effect/style.css
156 Views
0 Comments
@import url("https://fonts.googleapis.com/css2?family=Roboto:wght@400;700&display=swap");

* {
box-sizing: border-box;
}

body {
background-color: #000;
index.html cody/solygambas/html-css-javascript-projects/020-button ripple effect/index.html
340 Views
0 Comments
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="stylesheet" href="style.css" />
<title>Button Ripple Effect</title>
</head>
script.js cody/solygambas/html-css-javascript-projects/020-button ripple effect/script.js
225 Views
0 Comments
const buttons = document.querySelectorAll(".ripple");

buttons.forEach((button) => {
button.addEventListener("click", function (e) {
const x = e.clientX;
const y = e.clientY;
const buttonTop = e.target.offsetTop;
const buttonLeft = e.target.offsetLeft;